package com.jzmy.cultivate.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.plugins.Page;
import com.jzmy.cultivate.dao.CoursesDao;
import com.jzmy.cultivate.entity.Courses;
import com.jzmy.cultivate.entity.vo.CoursesAndTeacherVo;
import com.jzmy.cultivate.entity.vo.CoursesListVo;
import com.jzmy.cultivate.service.CoursesService;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @author mengzhichao
 * @create 2022-08-25-11:32
 */
@Service
public class CoursesServiceImpl extends ServiceImpl<CoursesDao, Courses> implements CoursesService {
    @Override
    public Page<CoursesListVo> selectListPage(int current, int number, Map map) {

        // 新建分页
        Page<CoursesListVo> page = new Page<CoursesListVo>(current, number);
        return page.setRecords(this.baseMapper.dyGetUserList(page,map));
    }

    @Override
    public CoursesAndTeacherVo selCourseDetail(Long id){
        return this.baseMapper.selCourseDetail(id);
    }
}
